package com.java.constructore;

public class Testcoordinate {
    double x, y, z;

    public Testcoordinate(double _x, double _y, double _z) {
        x = _x;
        y = _y;
        z = _z;
    }

    public void setX(double _x) {
        x = _x;
    }

    public void setY(double _y) {
        y = _y;
    }

    public void setZ(double _z) {
        z = _z;
    }

    public double Distance(Testcoordinate s1) {
        return Math.sqrt((x - s1.x) * (x - s1.x) + (y - s1.y) * (y - s1.y) + (z - s1.z) * (z - s1.z));
    }

    public static void main(String[] args) {
        Testcoordinate s1 = new Testcoordinate(3, 4, 5);
        Testcoordinate s2 = new Testcoordinate(6, 8, 10);
        System.out.println(s1.Distance(s2));
    }

}
